package gamepad;

import games.Game;
import games.labirynth.Labirynth;
import games.miniPacman.MiniPacman;
import games.padinvaders.PadInvaders;
import games.snake.Snake2D;
import games.swingPlus.SwingPlus;
import graphics.Bitmap2D;
import hardware.Display2D;
import hardware.UI;

public class gamepad {

private static PadInvaders myPadInvaders= new PadInvaders();	
	
private static  Display2D myDisplay= new Display2D();
private static  Snake2D snake2D=new Snake2D();	
private static  PadInvaders padInvaders=new PadInvaders();	
private static  SwingPlus swingPlus=new SwingPlus();	
private static  MiniPacman miniPacman=new MiniPacman();

 

//private static  Labirynth labirynth=new Labirynth();

public static void main(String[] args) throws InterruptedException
{
	int cmd;
	int activeGame;

	Bitmap2D a=new Bitmap2D(4,4);
	Bitmap2D b=new Bitmap2D(4,4);
	Bitmap2D c=new Bitmap2D(4,4);
	Bitmap2D d=new Bitmap2D(32,8);
	
	a.fill((short) 0x0f0);
	b.setPixel(0, 0, (short)0xf2f);
	
	while(true)
	{
	Display2D.clear();
	Display2D.display2DBitmap(0, 0, a);

	
	Display2D.doRepaint();
	
	c.min(b);
	
	Thread.sleep(500);
	a.not();
	
	Thread.sleep(500);
	d.fill((short)0);
	d.print8x8Char((char)65,(short) 0xfff, 0,0);
	d.print8x8Char((char)66,(short) 0x4ff, 8,0);
	d.print8x8Char((char)67,(short) 0xfff, 16,0);
	d.print8x8Char((char)68,(short) 0xfff, 24,0);

	d.mirror(Bitmap2D.AXIS_Y);
	int fg;
	for (fg=0;fg<32;fg++)
		{
		Display2D.display2DBitmap(0-fg, 0, d);
		Display2D.doRepaint();
		Thread.sleep(100);
		
		}
	}
	/*
	activeGame=0;
	cmd=Game.CMD_NONE;
	
	while (true)
	{
	
	switch(activeGame)
		{

		case 0:
			miniPacman.play();
	
			break;
			
		case 1:
			cmd=swingPlus.demo();

			if (cmd==Game.CMD_SELECT)
				swingPlus.play();
	
				break;
	
		case 2:
			cmd=padInvaders.demo();

			if (cmd==Game.CMD_SELECT)
				padInvaders.play();
			
			break;
			
			
		case 3:
			cmd=snake2D.demo();

			if (cmd==Game.CMD_SELECT)
				snake2D.play();
		
			break;
		}

	
	
	
	
	if (cmd==Game.CMD_PREV)
		{
		activeGame--;
		if (activeGame<0)
			activeGame=3;
		}
	
	if (cmd==Game.CMD_NEXT)
		{
		activeGame++;
		if (activeGame>3)
			activeGame=0;
		}
			Thread.sleep(500);


	}
*/
}
}